﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;
using System.Threading.Tasks;

namespace Rainbow.common
{
    public class FileManager
    {
        // program root DIR
        public string progRootDIR;
        /// <summary>
        /// 配置文件路径
        /// </summary>
        public string confDIR;
        /// <summary>
        /// 日志配置文件
        /// </summary>
        public string logConfigFile;
        /// <summary>
        /// 全局配置文件
        /// </summary>
        public string globalSettingFile;
        /// <summary>
        /// 连接管理
        /// </summary>
        public string connectInfoFile;

        public FileManager()
        {
            Init();
        }

        public int Init()
        {
            int rn = 0;

            progRootDIR = Directory.GetCurrentDirectory();
            confDIR = string.Format("{0}\\{1}", progRootDIR, "conf");

            logConfigFile = string.Format("{0}\\{1}", progRootDIR, "logConfig\\log4net.config"); //日志配置

            globalSettingFile = string.Format("{0}\\{1}", confDIR, "global_setting.xml"); //全局配置
            connectInfoFile = string.Format("{0}\\{1}", confDIR, "conn_config.xml"); //连接管理

            return rn;
        }
    }
}
